﻿using System;
using Newtonsoft.Json;

namespace Highchart.Core.PlotOptions
{

    [Serializable]
    public class PlotOptionsArea : PlotOptionsSeries
    {
        public string fillColor { get; set; }
        public double? fillOpacity { get; set; }
        public string lineColor { get; set; }
        public int? threshold { get; set; }
        
        public override string ToString()
        {
            var ignored = JsonConvert.SerializeObject(this, Formatting.None,
                                                      new JsonSerializerSettings
                                                          {
                                                              NullValueHandling = NullValueHandling.Ignore,
                                                              DefaultValueHandling = DefaultValueHandling.Ignore
                                                          });

            return string.IsNullOrWhiteSpace(ignored)
                       ? string.Empty
                       : string.Format("plotOptions: {{ series: {0} }},", ignored);
        }
    }

}
